package com.zb.controller;

import com.zb.service.TbSeckillOrderService;
import com.zb.vo.SeckillStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName TbSeckillOrderController
 * @Description 控制器
 * @Author zj
 * @Date 2022/11/16 09:31
 **/
@RestController
@RequestMapping("/tb-seckill-order-model")
public class TbSeckillOrderController {


    @Autowired
    public TbSeckillOrderService tbSeckillOrderModelService;


    @PostMapping("/add")
    public Integer addOrder(@RequestParam String id, @RequestParam String time, @RequestParam String username) {
        return tbSeckillOrderModelService.addOrder(id, time, username);
    }

    @GetMapping("/status")
    public SeckillStatus seckillStatus(String username){
        return tbSeckillOrderModelService.orderStatus(username);
    }

}
